<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="IPv6过渡技术, 十二惊惶的gitee">
    <meta name="description" content="IPv6过渡技术# 理解使用隧道机制实现IPv6穿越IPv4的原理
# 掌握6to4自动隧道、ISATAP自动隧道的实现机制
# 掌握Win 7下配置6to4路由器、ISATAP路由器的方法

[TOC]
IPv6过渡技术概述IPv6过渡期">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>IPv6过渡技术 | 十二惊惶的gitee</title>
    <link rel="icon" type="image/png" href="/shier_jinghuang/favicon.png">
    


    <!-- bg-cover style     -->



<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/awesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/materialize/materialize.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/aos/aos.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/animate/animate.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/lightGallery/css/lightgallery.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/matery.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/my.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/dark.css" media="none" onload="if(media!='all')media='all'">




    <link rel="stylesheet" href="/shier_jinghuang/libs/tocbot/tocbot.css">
    <link rel="stylesheet" href="/shier_jinghuang/css/post.css">




    



    <script src="/shier_jinghuang/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/shier_jinghuang/atom.xml" title="十二惊惶的gitee" type="application/atom+xml">
</head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/shier_jinghuang/" class="waves-effect waves-light">
                    
                    <img src="/shier_jinghuang/medias/1.jpg" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">十二惊惶的gitee</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
  <li>
    <a href="javascript:;" class="waves-effect waves-light" onclick="switchNightMode()" title="深色/浅色模式" >
      <i id="sum-moon-icon" class="fas fa-sun" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/shier_jinghuang/medias/1.jpg" class="logo-img circle responsive-img">
        
        <div class="logo-name">十二惊惶的gitee</div>
        <div class="logo-desc">
            
            犁牛之子骍且角，虽欲勿用，山川其舍诸
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://gitee.com/Im-so-scared-2/shier_jinghuang" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>十二惊惶
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://gitee.com/Im-so-scared-2/shier_jinghuang" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="十二惊惶" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/shier_jinghuang/medias/featureimages/8.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">IPv6过渡技术</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/shier_jinghuang/tags/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE%E5%88%86%E6%9E%90/">
                                <span class="chip bg-color">网络协议分析</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/shier_jinghuang/categories/%E7%BD%91%E7%BB%9C%E5%B7%A5%E7%A8%8B%E7%9B%B8%E5%85%B3/" class="post-category">
                                网络工程相关
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2022-12-24
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2022-12-24
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.9k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    10 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/shier_jinghuang/libs/prism/prism.min.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="IPv6过渡技术"><a href="#IPv6过渡技术" class="headerlink" title="IPv6过渡技术"></a>IPv6过渡技术</h2><pre class="line-numbers language-python" data-language="python"><code class="language-python"><span class="token comment"># 理解使用隧道机制实现IPv6穿越IPv4的原理</span>
<span class="token comment"># 掌握6to4自动隧道、ISATAP自动隧道的实现机制</span>
<span class="token comment"># 掌握Win 7下配置6to4路由器、ISATAP路由器的方法</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>

<p>[TOC]</p>
<h3 id="IPv6过渡技术概述"><a href="#IPv6过渡技术概述" class="headerlink" title="IPv6过渡技术概述"></a>IPv6过渡技术概述</h3><h4 id="IPv6过渡期的特点"><a href="#IPv6过渡期的特点" class="headerlink" title="IPv6过渡期的特点"></a>IPv6过渡期的特点</h4><ul>
<li>协议的过渡需要在网络中的所有节点上安装和配置新的协议，并且检验所有主机和路由器都能正确运行</li>
<li>要实施IPv6网络，必须充分考虑现有的网络条件，充分利用现有的条件构造下一代互联网，以避免过多的浪费</li>
</ul>
<h4 id="过渡时期采用技术的选择"><a href="#过渡时期采用技术的选择" class="headerlink" title="过渡时期采用技术的选择"></a>过渡时期采用技术的选择</h4><p><strong>双栈技术(Dual Stack)</strong></p>
<ul>
<li>让IPv4和IPv6共存于同一设备和网络中(RFC 2893)，采用该技术的节点上同时运行IPv4和IPv6两套协议栈</li>
<li>对IPv4和IPv6提供了完全的兼容，但对于IP地址耗尽问题没有任何帮助</li>
</ul>
<p><strong>隧道技术(Tunnel)</strong></p>
<ul>
<li>可以让IPv6业务在现有IPv4基础设施上传输(RFC2473、RFC2893、RFC3056)。将IPv6分组作为无结构的数据，封装在IPv4数据报中，被IPv4网络传输</li>
<li>隧道分为手工配置的隧道和自动配置的隧道</li>
<li>它不能解决IPv6节点和IPv4节点之间的相互通信问题</li>
</ul>
<p><strong>转换(翻译)技术</strong></p>
<ul>
<li>让纯IPv6节点能够和纯IPv4节点相互通信(RFC2766)</li>
<li>转换网关除了要进行IPv4和IPv6地址转换之外，还要进行协议的转换和翻译。</li>
</ul>
<h3 id="兼容的地址"><a href="#兼容的地址" class="headerlink" title="兼容的地址"></a>兼容的地址</h3><ol>
<li>IPv4兼容地址<ul>
<li>格式为:0:0:0:0:0:0:w.x.y.z:w或::w.x.y.z，(其中w.x.y.z是公共IPv4地址的点缀十进制表示)，用于IPv6/IPv4节点，它使IPv4/IPv6节点可以通过IPv4网络与IPv6节点进行通信</li>
<li>如果IPv6通信流的目的地址是IPv4兼容地址，则IPv6通信流会被IPv4报头自动封装，并通过IPv4网络发送到目标节点</li>
</ul>
</li>
<li>IPv4映射地址<ul>
<li>格式为:0:0:0:0:0:0:FFFF:w.x.y.z或::FFFF:w.x.y.z，用于将一个IPv4-only节点表示为一个IPv6节点，它仅用于内部表示</li>
<li>IPv4映射地址从不用作IPv6数据包的源地址或目的地址，主要用于一些在IPv4-only节点和IPv6-only节点间进行协议转换的实现方案中</li>
</ul>
</li>
<li>6over4地址</li>
</ol>
<ul>
<li>6over4地址由一个有效的64位单播地址前缀和接口标识符::WWXX:YYZZ组成(其中WWXX:YYZZ是接口的单播IPv41地J止w.X.y.2HJS1 八长示)</li>
<li>当使用RFC2529中定义的自动隧道机制时，系统会将6over4地址分配给一个连接到支持多播IPv4网络结构中的IPv6节点</li>
</ul>
<ol start="4">
<li>6to4地址<ul>
<li>6to4地址基于前缀2002:WWXX:YYZZ::/48(其中WWXX:YYZZ是公共IPv4地址w.x.y.z的冒号十六进制表示)</li>
<li>当使用RFC3056中定义的自动隧道机制时，6to4地址前缀用于创建站点的全球地址前缀，以及站点中的IPv6节点的全球地址</li>
</ul>
</li>
<li>ISATAP地址<ul>
<li>ISATAP(Intra-Site Automatic Tunnel Addressing Protocol)地址由一个有效的64位IPv4单播地址前缀和接口标符::5EFE:w.x.y.z所组成(其中w.x.y.z是一个接口的单播IPv4地址)</li>
<li>当使用RFC5214中定义的自动隧迫礼制时，系统会将使用ISATAP接口标识符的地址分配给IPv6/IPv4节点</li>
</ul>
</li>
</ol>
<h3 id="双栈技术"><a href="#双栈技术" class="headerlink" title="双栈技术"></a>双栈技术</h3><h4 id="工作原理"><a href="#工作原理" class="headerlink" title="工作原理"></a>工作原理</h4><p>即主机和路由器在同一网络接口上运行IPv4栈和IPv6栈。这样，双栈节点既可以接收和发送IPv4包和IPv6包，因而两个协议可以在同一网络中共存</p>
<img src="D:\gitee-blog\source\_posts\IPv6协议结构\IPv6双栈技术示意图.png" style="zoom:67%;" />

<h4 id="三种工作模式"><a href="#三种工作模式" class="headerlink" title="三种工作模式"></a>三种工作模式</h4><ul>
<li>只运行IPv6协议，对外呈现为IPv6节点;</li>
<li>只运行IPv4协议，对外呈现为IPv4节点;</li>
<li>同时运行IPv4协议和IPv6协议，对外呈现双栈模式。</li>
</ul>
<p>支持三种隧道模式为：不运行隧道；仅运行手工隧道；同时运行手工和自动隧道。</p>
<h4 id="双栈技术的特点"><a href="#双栈技术的特点" class="headerlink" title="双栈技术的特点"></a>双栈技术的特点</h4><blockquote>
<p>双栈技术是一切过渡技术的基础，隧道机制和翻译机制都要利用双栈节点</p>
</blockquote>
<ul>
<li>双栈技术应该能独立的配置IPv4和IPv6地址</li>
</ul>
<p>双栈技术的优点是互通性好，易于理解；缺点是需要给每个新的运行IPv6协议的网络设备和终端分配IPv4地址，不能解决IPv4地址短缺问题</p>
<h3 id="隧道技术"><a href="#隧道技术" class="headerlink" title="隧道技术"></a>隧道技术</h3><blockquote>
<p>隧道(Tunnel)是指将一种协议首部封装在另一种协议首部中，使得一种协议可以通过另一种协议的封装进行通信</p>
</blockquote>
<ul>
<li>优点在于隧道的透明性，不需要大量的IPv6专用设备和链路，可以明显的减少投资</li>
<li>缺点是配置麻烦，不能实现纯IPv4和纯IPv6主机之间的通信。</li>
</ul>
<h4 id="工作原理-1"><a href="#工作原理-1" class="headerlink" title="工作原理"></a>工作原理</h4><ul>
<li>核心思想是通过把IPv6数据报文封装入IPv4数据报文中，让现有IPv4网络成为载体以建立IPv6的通信，隧道两端的节点间数据报文的传送通过IPv4机制进行，隧道被看成一个直接连接的通道</li>
<li>隧道有两个端点，隧道入口点和隧道出口点。在入口点，路由器将IPv6分组封装在IPv4中，该IPv4的源地址和目的地址分别是入口和出口的IPv4地址。在出口点将IPv6分组取出转发给目的站点</li>
</ul>
<h4 id="IPv6数据包的封装步骤"><a href="#IPv6数据包的封装步骤" class="headerlink" title="IPv6数据包的封装步骤"></a>IPv6数据包的封装步骤</h4><ul>
<li>入口点将IPv6跳数限制减去1，并把该数据包封装进某个IPv4首部中。IPv4首部“协议”域设置为”41”，指示这个分组的净荷是一个IPv6的分组</li>
<li>通过隧道传输封装后的数据包，如果必要，封装后的IPv4数据包进行分段</li>
<li>隧道出口点接收到封装后的数据包。如果数据包被分段，出口点进行重组</li>
<li>出口点剥离IPv4首部，将IPv6数据包传递到目的地址</li>
</ul>
<img src="D:\gitee-blog\source\_posts\IPv6协议结构\IPv6数据包封装.png" style="zoom:67%;" />

<h4 id="隧道的实现方式"><a href="#隧道的实现方式" class="headerlink" title="隧道的实现方式"></a>隧道的实现方式</h4><ul>
<li><p>为了让数据通过隧道，必须知道两个端点的地址。确定入口点的是直接的因为它出现在IPv4基础结构的边界;确定隧道的出口点要复杂些</p>
</li>
<li><p>根据隧道终点地址的获得方式可将隧道分为<strong>配置隧道</strong>和<strong>自动隧道</strong>，其中配置隧道主要用于路由器到路由器</p>
</li>
<li><p>自动隧道有以下几种方式:</p>
<ul>
<li>Tunnel Brokers(RFC 3053):基于服务器的半自动隧道;</li>
<li>6to4(RFC 3056):路由器到路由器;</li>
<li>ISATAP:主机到路由器，路由器到主机，也可以主机到主机;.</li>
<li>6over4(RFC 2529):主机到路由器，路由器到主机;</li>
<li>Teredo:通过IPv4 NAT建立隧道;</li>
</ul>
</li>
</ul>
<h5 id="过渡初期"><a href="#过渡初期" class="headerlink" title="过渡初期"></a>过渡初期</h5><ul>
<li>使IPv6报文在IPv4网络中传输。手动隧道包括IPv6 over lPv4隧道，自动隧道包括IPv4兼容IPv6自动隧道、6to4隧道和ISATAP隧道</li>
</ul>
<h5 id="过渡后期"><a href="#过渡后期" class="headerlink" title="过渡后期"></a>过渡后期</h5><ul>
<li>使用IPv4 over lPv6隧道，使IPv4报文在lPv6网络中传输。</li>
</ul>
<h4 id="配置隧道"><a href="#配置隧道" class="headerlink" title="配置隧道"></a>配置隧道</h4><ul>
<li>需要隧道两个端点所在网络的管理员协作完成</li>
<li>隧道的端点地址由配置来决定，不需要为站点分配特殊的IPv6地址</li>
<li>适用于经常通信的IPv6站点之间</li>
</ul>
<h4 id="基本的自动隧道技术"><a href="#基本的自动隧道技术" class="headerlink" title="基本的自动隧道技术"></a>基本的自动隧道技术</h4><ul>
<li>自动配置的隧道<ul>
<li>端点地址根据分组的目的地址确定，适用于单独的主机之间或者不经常通信的站点之间。需要站点使用IPv4兼容的IPv6地址(O::IPv4/96)，且站点之间有可用的IPv4连接，每个采用这种机制的主机都需要一个IPv4地址</li>
<li>不能解决IPv4地址空间耗尽的问题。两个端点都必须支持双协议栈</li>
</ul>
</li>
</ul>
<h5 id="IPv4多播隧道6-over-4"><a href="#IPv4多播隧道6-over-4" class="headerlink" title="IPv4多播隧道6 over 4"></a>IPv4多播隧道6 over 4</h5><ul>
<li>与配置隧道不同的是它不需要任何地址配置;与自动隧道不同的是它不要求使用lIPv4兼容的IPv6地址</li>
<li>当通过支持6 over 4的路由器与外界相连时，站点内的主机可以和外部IPv6站点通信</li>
</ul>
<h4 id="6to4隧道"><a href="#6to4隧道" class="headerlink" title="6to4隧道"></a>6to4隧道</h4><blockquote>
<p>6to4是一种自动隧道机制，通常在站点的边界路由器之间建立隧道，它为IPv6站点和主机之间提供了跨IPv4 Internet的单播IPv6连通性</p>
</blockquote>
<p><strong>使用前缀为2002:IPv4addr:/48的6to4地址，其中IPv4addr是站点边界路由器的IPv4地址</strong></p>
<ul>
<li>当两个站点中任两台主机通信时，隧道首节点自动从IPv6源地址和目的地址中提取出隧道首尾节点的IPv4地址，在两个站点的边界路由器之间建立一条IPv4隧道</li>
</ul>
<p>隧道不需要维护任何信息，通信开始时建立，通信结束时自动撤销</p>
<h5 id="6to4路由器"><a href="#6to4路由器" class="headerlink" title="6to4路由器"></a>6to4路由器</h5><blockquote>
<p>6to4路由器是支持使用6to4隧道接口的IPv6/IPv4路由器，它通常用于一个站点中的6to4主机和IPv4网络(如: Internet)上的其它6to4路由器或6to4中继路由器之间转发目标为6to4地址的通信流，充当了隧道的端点</p>
</blockquote>
<p>6to4路由器应实现双栈和6to4隧道功能，并且至少有一个全球唯一的可路由IPv4地址需要使用额外的处理逻辑，以正确地封装和拆封，并且还可能需要额外的手工配置</p>
<h5 id="6to4中继路由器"><a href="#6to4中继路由器" class="headerlink" title="6to4中继路由器"></a>6to4中继路由器</h5><ul>
<li>在Internet上的6to4路由器和IPv6 Internet上的主机之间转发目标为6to4地址的通信流的IPv6/IPv4路由器</li>
</ul>
<img src="D:\gitee-blog\source\_posts\IPv6协议结构\6to4中继路由器.png" style="zoom:67%;" />

<h4 id="lSATAP隧道"><a href="#lSATAP隧道" class="headerlink" title="lSATAP隧道"></a>lSATAP隧道</h4><blockquote>
<p>站点内自动隧道寻址协议(Intra-Site Automatic Tunnel AddressingProtocol)，将没有IPv6路由器的IPv4内部网中的IPv6节点连接起来，为IPv6主机之间提供了<strong>跨越IPv4内部网络</strong>单播IPv6连通性</p>
</blockquote>
<ul>
<li>ISATAP主机使用标准地址自动配置机制来创建lSATAP地址。ISATAP地址格式为:64位前缀:5EFE: w.x.y.z。其中前缀可以是链路本地地址前缀、站点本地前缀和全球前缀(包括6to4前缀)</li>
</ul>
<img src="D:\gitee-blog\source\_posts\IPv6协议结构\ISATAP隧道.png" style="zoom:67%;" />

<h3 id="协议转换技术"><a href="#协议转换技术" class="headerlink" title="协议转换技术"></a>协议转换技术</h3><h4 id="NAT技术"><a href="#NAT技术" class="headerlink" title="NAT技术"></a>NAT技术</h4><ul>
<li>NAT有三种类型:静态NAT;动态NAT;网络地址端口转换NAPT</li>
<li>对于IPv4向IPv6过渡机制来讲，这里的内网和外网可以分别对应IPv4网络或IPv6网络</li>
<li>NAT网关使用一个IPv4地址池，并把这些地址和相应IPv6地址绑定在一起。不需要对终端节点做任何修改</li>
<li>转换技术依据转换所对应计算机网络体系结构的层次。缺点是不支持lPv6高级特性，例如端到端的安全</li>
</ul>
<h3 id="过渡机制的选择"><a href="#过渡机制的选择" class="headerlink" title="过渡机制的选择"></a>过渡机制的选择</h3><p>在现有的IPv4网络上逐步融合IPv6技术，过渡的内容包括:</p>
<blockquote>
<p>网络的过渡；主机节点的过渡；应用程序的过渡；IPv4网络与IPv6网络之间的互通；IPv6网络之间的互通</p>
</blockquote>
<h4 id="lPv6过渡时期建议采用的过渡原则"><a href="#lPv6过渡时期建议采用的过渡原则" class="headerlink" title="lPv6过渡时期建议采用的过渡原则:"></a>lPv6过渡时期建议采用的过渡原则:</h4><ul>
<li>能直接建立IPv6链路的情况下，使用纯IPv6路由</li>
<li>不能使用IPv6链路的情况下，IPv6节点间使用隧道技术</li>
<li>双栈的IPv4/IPv6主机和纯IPv4或纯IPv6网络的主机通信尽量不要采用协议转换，直接自动选择相应的通信协议</li>
<li>纯IPv6网络和纯IPv4网络主机之间的通信，使用协议转换或应用层网关，所设计的协议转换器或ALG应该尽量保证不修改原有应用</li>
<li>采用逐步渐进的过渡方式，以保护原有IPv4网络的投资，过渡的技术应尽可能简单，尽量保证IPv4和IPv6之间的互操作性</li>
</ul>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/shier_jinghuang/about" rel="external nofollow noreferrer">十二惊惶</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://im-so-scared-2.gitee.io/shier_jinghuang/shier_jinghuang/2022/12/24/IPv6%E8%BF%87%E6%B8%A1%E6%8A%80%E6%9C%AF/">https://im-so-scared-2.gitee.io/shier_jinghuang/shier_jinghuang/2022/12/24/IPv6%E8%BF%87%E6%B8%A1%E6%8A%80%E6%9C%AF/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/shier_jinghuang/about" target="_blank">十二惊惶</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/shier_jinghuang/tags/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE%E5%88%86%E6%9E%90/">
                                    <span class="chip bg-color">网络协议分析</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/shier_jinghuang/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/shier_jinghuang/2023/02/10/Linux/">
                    <div class="card-image">
                        
                        
                        <img src="/shier_jinghuang/medias/featureimages/16.jpg" class="responsive-img" alt="Linux 知识点汇总">
                        
                        <span class="card-title">Linux 知识点汇总</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2023-02-10
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shier_jinghuang/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                    学习笔记
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shier_jinghuang/tags/Linux/">
                        <span class="chip bg-color">Linux</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/shier_jinghuang/2022/12/16/ICMPv6/">
                    <div class="card-image">
                        
                        
                        <img src="/shier_jinghuang/medias/featureimages/12.jpg" class="responsive-img" alt="ICPMv6协议基础">
                        
                        <span class="card-title">ICPMv6协议基础</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2022-12-16
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shier_jinghuang/categories/%E7%BD%91%E7%BB%9C%E5%B7%A5%E7%A8%8B%E7%9B%B8%E5%85%B3/" class="post-category">
                                    网络工程相关
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shier_jinghuang/tags/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE%E5%88%86%E6%9E%90/">
                        <span class="chip bg-color">网络协议分析</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeBlockFuction.js"></script>


  <!-- 是否加载使用自带的 prismjs. -->
  <script type="text/javascript" src="/shier_jinghuang/libs/prism/prism.min.js"></script>


<!-- 代码语言 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeShrink.js"></script>



    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/shier_jinghuang/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/shier_jinghuang/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="503838841"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/shier_jinghuang/libs/aplayer/APlayer.min.js"></script>
<script src="/shier_jinghuang/libs/aplayer/Meting.min.js"></script>

    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2023</span>
            
            <a href="/shier_jinghuang/about" target="_blank">十二惊惶</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
                &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                        class="white-color">289.6k</span>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/blinkfox" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1181062873@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1181062873" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1181062873" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/shier_jinghuang/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/shier_jinghuang/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 白天和黑夜主题 -->
<div class="stars-con">
    <div id="stars"></div>
    <div id="stars2"></div>
    <div id="stars3"></div>  
</div>

<script>
    function switchNightMode() {
        $('<div class="Cuteen_DarkSky"><div class="Cuteen_DarkPlanet"></div></div>').appendTo($('body')),
        setTimeout(function () {
            $('body').hasClass('DarkMode') 
            ? ($('body').removeClass('DarkMode'), localStorage.setItem('isDark', '0'), $('#sum-moon-icon').removeClass("fa-sun").addClass('fa-moon')) 
            : ($('body').addClass('DarkMode'), localStorage.setItem('isDark', '1'), $('#sum-moon-icon').addClass("fa-sun").removeClass('fa-moon')),
            
            setTimeout(function () {
            $('.Cuteen_DarkSky').fadeOut(1e3, function () {
                $(this).remove()
            })
            }, 2e3)
        })
    }
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/shier_jinghuang/libs/materialize/materialize.min.js"></script>
    <script src="/shier_jinghuang/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/shier_jinghuang/libs/aos/aos.js"></script>
    <script src="/shier_jinghuang/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/shier_jinghuang/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/shier_jinghuang/js/matery.js"></script>

    

    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/shier_jinghuang/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/shier_jinghuang/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/shier_jinghuang/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/shier_jinghuang/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
